from django.contrib import admin
from django.urls import path,include
from .views import *
from rest_framework.routers import DefaultRouter

#  如果只是简单的登录  就不用在写视图集 可以直接用自带的
from rest_framework_simplejwt.views import TokenObtainPairView


urlpatterns = [
        path("verification/<str:func>/<uuid:uuid>/",ImageVerifyView.as_view()),

        #  TokenObtainPairView 登录的校验   只有用户和密码的操作   如果有验证码那就不适用
        # path("login/",TokenObtainPairView.as_view())
        path("login/",MyTokenTokenObtainPairView.as_view())

]

router = DefaultRouter()
router.register('users',UserViewSet)
urlpatterns += router.urls

#                  注册
#  前端请求的路由
#  http://127.0.0.1:8080/api/user/verification/register/6d411bb1-3076-4611-aa4a-fbad59cd98b3/

#  后端请求的路由
#  http://http://127.0.0.1:8000/user/verification/90b454c9-0a1c-4546-b5d2-425db18d9588/

#  api/ ==>>  127.0.0.1:8000/

#               登录

# 前端请求的路由
#  http://127.0.0.1:8080/api/user/verification/login/72469ac8-14ba-4a3f-9bcf-f954506bbb34/